package com.inspur.controller;

import java.util.ArrayList;
import java.util.List;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.inspur.entity.TestEntity;
import com.wordnik.swagger.annotations.ApiOperation;
import com.wordnik.swagger.annotations.ApiParam;
@Controller
public class TestSwaggerController {
    /**
     * 根据用户名获取用户对象
     * @param name
     * @return
     */
    @RequestMapping(value="getUserByName", method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation(value = "根据用户名获取用户对象", httpMethod = "GET", response = List.class, notes = "根据用户名获取用户对象")
    public List getUserByName(@ApiParam(required = true, name = "name", value = "用户名") @PathVariable String name) throws Exception{
        TestEntity testEntity=new TestEntity();
        testEntity.setUname("甄嬛传");
        List<TestEntity> result = new ArrayList<TestEntity>();
        result.add(0, testEntity);
        return result;
    }
}
